@tailwind base;
@tailwind components;
@tailwind utilities;

// 全局变量定义
@primary-color: #1890ff;
@primary-color-hover: #40a9ff;
@primary-1: #e6f7ff;
@success-color: #52c41a;
@warning-color: #faad14;
@error-color: #ff4d4f;
@info-color: #1890ff;

@text-color: rgba(0, 0, 0, 0.85);
@text-color-secondary: rgba(0, 0, 0, 0.65);
@text-color-disabled: rgba(0, 0, 0, 0.25);

@background-color-light: #ffffff;
@background-color-base: #f5f5f5;
@background-color-dark: #001529;

// Ant Design 兼容变量
@bg-color: @background-color-base;
@component-background: @background-color-light;
@item-hover-bg: rgba(0, 0, 0, 0.06);
@layout-body-background: @background-color-light;

@border-color-base: #d9d9d9;
@border-color-split: #f0f0f0;

@border-radius-base: 6px;
@border-radius-sm: 4px;
@border-radius-lg: 8px;

// 字体设置
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  font-weight: 400;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// 全局样式重置
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: @background-color-base;
  color: @text-color;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
  
  &:hover {
    background: #a8a8a8;
  }
}

// 暗色主题
[data-theme='dark'] {
  // 重新定义暗色模式下的变量
  --text-color: rgba(255, 255, 255, 0.85);
  --text-color-secondary: rgba(255, 255, 255, 0.65);
  --text-color-disabled: rgba(255, 255, 255, 0.25);
  
  --background-color-light: #141414;
  --background-color-base: #000000;
  --background-color-dark: #001529;
  
  --component-background: #1f1f1f;
  --layout-body-background: #141414;
  --item-hover-bg: rgba(255, 255, 255, 0.08);
  
  --border-color-base: #434343;
  --border-color-split: #303030;
  
  body {
    background-color: #000000;
    color: rgba(255, 255, 255, 0.85);
  }
  
  ::-webkit-scrollbar-track {
    background: #2f2f2f;
  }
  
  ::-webkit-scrollbar-thumb {
    background: #6c6c6c;
    
    &:hover {
      background: #8c8c8c;
    }
  }
}

// 动画效果
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 300ms ease-in;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 300ms ease-in;
}

// 工具类
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.full-width {
  width: 100%;
}

.full-height {
  height: 100%;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

// 响应式断点
@screen-xs: 480px;
@screen-sm: 576px;
@screen-md: 768px;
@screen-lg: 992px;
@screen-xl: 1200px;
@screen-xxl: 1600px;

// 响应式工具类
.hidden-xs {
  @media (max-width: @screen-xs) {
    display: none !important;
  }
}

.hidden-sm {
  @media (max-width: @screen-sm) {
    display: none !important;
  }
}

.hidden-md {
  @media (max-width: @screen-md) {
    display: none !important;
  }
}

.hidden-lg {
  @media (max-width: @screen-lg) {
    display: none !important;
  }
}